package monitoring.application;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import monitoring.UssProjectView;
import server.Server;

/*
 * Author : Mohamed Delhomme
 */

public class StartServerAction extends AbstractAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private UssProjectView monitor;

	public StartServerAction(UssProjectView monitor, String texte) {
		super(texte);

		this.monitor = monitor;
	}

	public void actionPerformed(ActionEvent e) {
		monitor.server = new Server();
		
		monitor.labelStatusServer.setText("   Status : server currently on   ");
		
		monitor.buttonStartServer.setEnabled(false);
		monitor.buttonStopServer.setEnabled(true);
		
		monitor.startServerItem.setEnabled(false);
		monitor.stopServerItem.setEnabled(true);
	}
}
